<?
include_once 'include/include.php';
c_create::createClass('friendlink');
$link = new friendlink();
$outvar[headline] = '添加链接';

if ($_POST){
	if ($link->submitRecord($_POST)){
		$_SESSION[showtips]	 = $link->action.'成功！';
		if (empty($_POST[Llinkid])){
			header('location:Friendlink_manage.php');
			exit;
		}else {
			$outvar[headline] = '修改链接';
			////如果修改成功，就重新读取这条记录，如果这里直接用$_post的值的话，如果附件是第一次提交的话
			////将无法显示
			$_POST = $link->getOneRecord($_POST[Llinkid],0);
		}
	}else {
		assignMore($link->error);
		$_SESSION[showtips]	 = $link->action.'失败！';
	}
}elseif ($_GET[id]){
	$outvar[headline] = '修改链接';
	$_POST = $link->getOneRecord($_GET[id],0);
}
if ($_POST){ $_POST = specialhtml(stripslashes_deep($_POST),'Acontent');}

assignMore($_POST);
$outvar[catalog] = $link->getTypeList();
outFile("friendlink_add");
?>